#ifndef _DRAW_H
#define _DRAW_H

/*-------------------------------------------------------------------*/
/*  Type definition                                                  */
/*-------------------------------------------------------------------*/
#ifndef DWORD
typedef unsigned long  DWORD;
#endif /* !DWORD */

#ifndef WORD
typedef unsigned short WORD;
#endif /* !WORD */

#ifndef BYTE
typedef unsigned char  BYTE;
#endif /* !BYTE */

#ifndef u32
typedef unsigned int  u32;
#endif /* !u32 */

#ifndef u16
typedef unsigned short  u16;
#endif /* !u16*/

#ifndef u8
typedef unsigned char  u8;
#endif /* !u8 */

#ifndef vu8
typedef volatile unsigned char  vu8;
#endif /* !vu8 */


typedef unsigned int PIXEL;



#ifndef BIT15
#define BIT15 (1<<15)
#endif

// macro creates a 15 bit color from 3x5 bit components
#define RGBd(r,g,b)  ((b)|((g)<<6)|((r)<<11))
#define RGB15(r,g,b)  ((r)|((g)<<5)|((b)<<10))
#define RGB5(r,g,b)  ((r)|((g)<<5)|((b)<<10))
#define RGB8(r,g,b)  (((r)>>3)|(((g)>>3)<<5)|(((b)>>3)<<10))

void InfoNES_LoadFrame();
void InfoNES_Wait();
int InfoNES_Menu();
void *emulation_thread(void *args);
void prepareImage(CGImageRef sourceImage);

#endif
